import { Client } from '@gradio/client'




export default eventHandler(async (event) => {
    const data = await readFormData(event)
    const file = data.get('file')
    // const url = process.env.NODE_ENV == 'development' ? 'http://koutu.satapp.cn' : 'http://localhost:7000'
    const url = 'http://koutu.satapp.cn'



    const app = await Client.connect(url)
    const result = await app.predict("/predict", [file, "u2netp", ""])
    return result.data[0]
})
